<%@page import="fr.cinescope2014.modeles.SalleParis"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html" pageEncoding="UTF-8" %>

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>Salles de Paris</title>
        <link href="/CineScope2014FO/css/principal.css" rel="stylesheet" type="text/css">
    </head>

    <body>
        <%@include file="../jsp/_entete.jsp" %>
        <%@include file="../jsp/_rechercher.jsp" %>
        <%@include file="../jsp/_sommaire.jsp" %>

        <div id="centre">

            <h3>Salles de Paris</h3>

            <%-- Modele --%>
            <%!
            %>

            <%                // Ah !
                String lsArrondissementAvant = "";
                String lsArrondissementCourant = "";

                String lsCinemaAvant = "";
                String lsCinemaCourant = "";

                List<SalleParis> liste = (List) request.getAttribute("liste");
                for (SalleParis sp : liste) {

            %>
            <%      // Ah !!!      
                lsArrondissementCourant = sp.getNomArrondissement();
                if (!lsArrondissementCourant.equals(lsArrondissementAvant)) {
                    out.println("<hr/>");
                    out.println(sp.getNomArrondissement());
                    out.println("<hr/>");
                    lsArrondissementAvant = lsArrondissementCourant;
                }
            %>


            <% // Ah!!!!
                lsCinemaCourant = sp.getNomCinema();
                if (!lsCinemaCourant.equals(lsCinemaAvant)) {
                    out.println("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='#' class='lienNoir'>" + lsCinemaCourant + "</a>");
                    out.println("<br/>");
                    lsCinemaAvant = lsCinemaCourant;
                }
            %>
            <% // ...
                out.print("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='#' class='lienRouge'>" + sp.getTitreFilm() + "</a>");
                if (sp.getVersionProjection() != null) {
                    out.print(" (" + sp.getVersionProjection() + ")");
                }
            %>

            <br/>
            <%
                }
            %>  

        </div>

        <%@include file="../jsp/_pied.jsp" %>
    </body>
</html>